// manifest.config.ts
import { defineManifestConfig } from '@uni-helper/vite-plugin-uni-manifest'
import path from 'node:path'
import { loadEnv } from 'vite'

// 获取环境变量的范例
const env = loadEnv(process.env.NODE_ENV!, path.resolve(process.env.VITE_ROOT_DIR, 'env'))
// console.log(env)
const {
  VITE_APP_TITLE,
  VITE_UNI_APPID,
  VITE_WX_APPID,
  VITE_APP_PUBLIC_BASE,
  VITE_FALLBACK_LOCALE,
} = env

export default defineManifestConfig({
  name: VITE_APP_TITLE,
  appid: VITE_UNI_APPID,
  description: '',
  versionName: '1.0.0',
  versionCode: '100',
  transformPx: false,
  locale: VITE_FALLBACK_LOCALE, // 'zh-Hans'
  h5: {
    router: {
      base: VITE_APP_PUBLIC_BASE,
    },
  },
  "uni-app-x" : {},
   "app" : {
	  "distribute" : {
		  "icons" : {
			  "android" : {
				  "hdpi" : "",
				  "xhdpi" : "",
				  "xxhdpi" : "",
				  "xxxhdpi" : ""
			  }
		  }
	  }
  },
  "app-android": {
  	"distribute": {
  		"modules": {
  			"uni-payment": {
  				"alipay": {},
  				"wxpay": {}
  			},
  			"uni-location": {
  				"system": {},
  				"tencent": {}
  			},
  			"uni-push": {},
  			"uni-map": {
  				"tencent": {}
  			}
  		},
  		"icons": {
  			"xxhdpi": "package/icon144.png",
  			"xxxhdpi": "package/icon192.png"
  		},
  		"splashScreens": {
  			"default": {}
  		}
  	}
  },
  "app-ios": {
  	"distribute": {
  		"modules": {
  			"uni-payment": {
  				"alipay": {},
  				"wxpay": {
  					"appid": "",
  					"universalLink": ""
  				}
  			},
  			"uni-location": {
  				"system": {},
  				"tencent": {}
  			},
  			"uni-push": {},
  			"uni-map": {
  				"tencent": {}
  			}
  		},
  		"icons": {
  			"appstore": "package/icon1024.png"
  		},
  		"splashScreens": {}
  	}
  },
  /* 快应用特有相关 */
  quickapp: {},
  uniStatistics: {
    enable: false,
  },
  vueVersion: '3',
})
